﻿using HomeCareLibrary.Core.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HomeCareLibrary.Core.JsonObjects
{
   public class User
    {
        public Nullable<int> user_id { get; set; }
        public string user_name { get; set; }
        public string password { get; set; }
        public Sponsor sponsor { get; set; }
        public Actions actions { get; set; }

        public User()
        { }


        public User(int _user_id, string _user_name, string _password, string _sponsor, string _welcome_image,
            string _welcome_image_chg_time, string _iname_line, string _icompany_name, string _iemail_address,
            string _iphone_number, string _itagline, string _ilogo_pic, string _iwebsite, string _spon_change_time,
            string _AppLogin, string _DbStatus, string _Status)
        {
            user_id = _user_id;
            user_name = _user_name != string.Empty ?_user_name : null ;
            password = _password != string.Empty ? _password : null;
            sponsor = new Sponsor(_sponsor, _welcome_image, _welcome_image_chg_time, _iname_line, _icompany_name, 
                _iemail_address, _iphone_number, _itagline, _ilogo_pic, _iwebsite, _spon_change_time);
            actions = new Actions(_AppLogin, _DbStatus, _Status);
        }

        public User(CTAppReopenDto appReopenDto)
        {
            user_id = appReopenDto.user_id;
            user_name = appReopenDto.user_name;
            password = appReopenDto.password;
            sponsor = new Sponsor(appReopenDto.sponsor, appReopenDto.welcome_image, appReopenDto.welcome_image_chg_time,
                appReopenDto.iname_line, appReopenDto.icompany_name, appReopenDto.iemail_address, appReopenDto.iphone_number,
                appReopenDto.itagline, appReopenDto.ilogo_pic, appReopenDto.iwebsite, appReopenDto.spon_change_time);
            actions = new Actions(appReopenDto.AppLogin, appReopenDto.DbStatus, appReopenDto.Status);
        }
    }
}
